package com.wkn.wknAdmin.mapper;

import com.wkn.wknAdmin.entity.Menu;
import com.wkn.wknAdmin.entity.Role;
import com.wkn.wknAdmin.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @Title:
 * @Description:
 * @Author: WKN
 * CreateDate: 2022/8/13 14:33
 */
@Mapper
public interface MenuMapper {


    /**
     * 添加菜单
     * @param menu
     * @return
     */
    int insert(Menu menu );


    /**
     * 更新菜单
     * @param menu
     * @return
     */
    int update(Menu menu);


    /**
     *  查询单个菜单
     * @param mname
     * @return
     */
    Menu getOne(@Param("mname") String mname);
    Menu getOneById(@Param("id") Integer id );



    List<Integer> findAllIds();


    /**
     *  获取全部菜单
     * @return
     */
    List<Menu> findAll();


    /**
     * 根据id批量查询
     * @param ids
     * @return
     */
    List<Menu> findMenuByIds(@RequestBody List<Integer> ids);

}
